package com.ljfresh.customer.mapper.common;

import com.ljfresh.customer.page.PageObject;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface CommonMapper<T,GK> {

    //新增
    Long insert(T entity);

    //修改
    Long update(T entity);

    //根据主键删除
    Long delete(GK id);

    //根据条件删除
    Long deleteAll(Map<String,Object> map);

    //查询总数
    Long count();

    //根据条件查询数量
    Long count(Map<String,Object> map);

    //根据主键查询(GK id)
    T find (GK id);

    //根据条件查询
    List<T> findByParams(Map<String,Object> map);

    //查询所有
    List<T> findAll();

    //分页查询
    List<T> findByPage(PageObject po);
}
